<!-- inc:head -->
<script type="text/javascript" src="{func include_js list.js}"></script>
<script type="text/javascript">
$(document).ready(function(){
	top.$.desktop.title('{$rs.title}');
});
</script>
<!-- if $project_list -->
<script type="text/javascript">
function pendding_info()
{
	var url = get_url('index','pendding_sublist');
	$.ajax({
		'url':url,
		'cache':false,
		'async':true,
		'dataType':'json',
		'success': function(rs){
			if(rs.status == "ok"){
				var list = rs.content;
				var html = '<em class="toptip">{total}</em>';
				var total = 0;
				for(var key in list){
					$("li[id=project_"+list[key]['id']+"] em").remove();
					$("li[id=project_"+list[key]['id']+"]").append(html.replace('{total}',list[key]['total']));
				}
				//每隔一分钟检测一次
				window.setTimeout("pendding_info()", 60000);
			}else{
				//移除提示
				$("em.toptip").remove();
				//每隔三分钟进行一次检测
				window.setTimeout("pendding_info()", 180000);
			}
		}
	});
}

$(document).ready(function(){
	pendding_info();
	$("#project li").mouseover(function(){
		$(this).addClass("hover");
	}).mouseout(function(){
		$(this).removeClass("hover");
	}).click(function(){
		var url = $(this).attr("href");
		if(url){
			$.phpok.go(url);
		}else{
			alert("未指定动作！");
			return false;
		}
	});
});
</script>
<div class="tips"><span class="red">{$rs.title}</span> 子项信息，请点击进入修改</div>
<ul class="project" id="project">
	<!-- loop from=$project_list key=$key value=$value -->
	<li id="project_{$value.id}" title="{$value.title}" status="{$value.status}" href="{url ctrl=list func=action id=$value.id/}">
		<div class="img"><img src="{$value.ico ? $value.ico : 'images/ico/default.png'}" /></div>
		<div class="txt" id="txt_{$value.id}">{$value.nick_title ? $value.nick_title : $value.title}</div>
	</li>
	<!-- /loop -->
</ul>
<div class="clear"></div>
<!-- /if -->

<!-- if $rs.module -->
<script type="text/javascript">
function list_content_search()
{
	$.dialog({
		'title':'{lang搜索}',
		'content':document.getElementById("top_search_html"),
		'ok':function(){
			var url = get_url("list",'action','id={$pid}');
			var status = $("#search_status").val();
			if(status){
				url += "&status="+$.str.encode(status);
			}
			var attr = $("#search_attr").val();
			if(attr){
				url += "&attr="+$.str.encode(attr);
			}
			var keywords = $("#keywords").val();
			if(keywords){
				url += '&keywords='+$.str.encode(keywords);
			}
			var cateid = $("#cateid").val();
			if(cateid){
				url += '&cateid='+cateid;
			}
			if(!cateid && !keywords && !attr && !status){
				$.dialog.alert('{lang请输入要搜索的关键字或属性}');
				return false;
			}else{
				$.phpok.go(url);
			}
			return true;
		},
		'okVal':'{lang执行搜索}',
		'lock':true,
		'drag':false
	});
}
function reply_it(id,title)
{
	var url = get_url('list','comment','id='+id);
	$.dialog.open(url,{
		'title':'{lang评论：}'+title,
		'lock':true,
		'width':'90%',
		'height':'90%',
		'cancel':function(){return true;}
	});
}
</script>
<div class="tips">
	{lang您当前的位置：}{lang内容管理}
	<!-- loop from=$plist key=$key value=$value id=plist_id -->
	&raquo; <a href="{url ctrl=list func=action id=$value.id/}" title="{$value.title}">{$value.nick_title ? $value.nick_title : $value.title}</a>
	<!-- /loop -->
	<!-- if $show_parent_catelist -->
	&raquo; <a href="{url ctrl=list func=action id=$pid cateid=$show_parent_catelist/}">{$parent_cate_rs.title}</a>
	<!-- /if -->
	<!-- if $keywords -->
	&raquo; <span class="red">{$keywords}</span>
	<!-- /if -->
	<div class="action"><a href="{url ctrl=list func=set id=$pid/}">{lang编辑项目}</a></div>
	<div class="action"><a href="{url ctrl=list func=edit pid=$pid/}">{lang添加内容}</a></div>
	<div class="action"><a href="javascript:list_content_search();void(0);">{lang搜索}</a></div>
	<span id="AP_ACTION_HTML" title="插件节点，后台内容列表管理栏面包屑"></span>
</div>
<div style="display:none" id="top_search_html">
	<div class="table">
		<div class="title">
			{lang审 核：}
			<select name="status" id="search_status">
				<option value="">不限</option>
				<option value="1"{if $status==1} selected{/if}>已审核</option>
				<option value="2"{if $status==2} selected{/if}>未审核</option>
			</select>
		</div>
	</div>
	<div class="table">
		<div class="title">
			{lang属 性：}
			<select name="attr" id="search_attr">
				<option value="">{lang属性选择}</option>
				<!-- loop from=$attrlist key=$key value=$value -->
				<option value="{$key}"{if $attr == $key} selected{/if}>{$value}</option>
				<!-- /loop -->
			</select>
		</div>
	</div>
	<!-- if $catelist -->
	<div class="table">
		<div class="title">
			{lang分 类：}
			<select name="top_cate_id" id="top_cate_id">
				<option value="">{lang全部分类}</option>
				<!-- loop from=$catelist key=$key value=$value -->
				<option value="{$value.id}"{if $cateid == $value.id} selected{/if}>{$value.title}</option>
				<!-- /loop -->
			</select>
		</div>
	</div>
	<!-- /if -->
	<div class="table">
		<div class="title">
			{lang关键字：}<input type="text" id="keywords" name="keywords" class="default" value="{$keywords}" />
		</div>
	</div>
</div>
<!-- /if -->

<!-- if $rs.admin_note -->
<div class="tips clearfix">{$rs.admin_note}</div>
<!-- /if -->


<!-- if $catelist -->
<ul class="list_cate clearfix">
	<!-- loop from=$catelist key=$key value=$value -->
	<li>
		<div class="cate cate_{$catelist_id.num%9}"><a href="{echo admin_url('list','action')}&id={$pid}&cateid={$value.id}">{$value.title}</a></div>
		<div class="cate_add cate_{$catelist_id.num%9}"><a href="{echo admin_url('list','edit')}&pid={$pid}&cateid={$value.id}"><img src="images/cate_add.png" border="0" alt="" /></a></div>
	</li>
	<!-- /loop -->
</ul>
<div class="clear"></div>
<!-- /if -->

<!-- if $rslist -->
<div class="list clearfix">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
	<th width="20px">&nbsp;</th>
	<th width="20px">&nbsp;</th>
	<th>&nbsp;</th>
	<th class="lft">{$rs.alias_title ? $rs.alias_title : P_Lang('主题')}</th>
	<!-- if $rs.cate -->
	<th>{lang主分类}</th>
	<!-- /if -->
	<!-- loop from=$layout key=$key value=$value -->
		<!-- if $key == "dateline" -->
		<th style="width:150px">{$value}</th>
		<!-- elseif $key == "hits" -->
		<th style="width:50px">{lang点击}</th>
		<!-- else -->
		<th class="lft">{$value}</th>
		<!-- /if -->
	<!-- /loop -->
	<th style="width:80px">{lang排序}</th>
	<th style="width:30px">&nbsp;</th>
	<th style="width:120px;">&nbsp;</th>
</tr>
<!-- php:$tmp_m = 0 -->
<!-- foreach($rslist AS $key=>$value) -->
<!-- php:$tmp_m++ -->
<tr id="list_{$value.id}" title="{$rs.alias_title ? $rs.alias_title : P_Lang('主题')}: {$value.title}&#10;{lang发布日期}: {echo date('Y-m-d H:i:s',$value[dateline])}">
	<td class="center"><input type="checkbox" name="ids[]" id="id_{$value.id}" value="{$value.id}" /></td>
	<td><span class="status{$value.status}" id="status_{$value.id}" onclick="set_status({$value.id})" value="{$value.status}"></span></td>
	<td class="center">{$value.id}</td>
	<td><label for="id_{$value.id}">
		{$value.title}
		<!-- if $value.attr -->
			<!-- php:$attr = explode(",",$value['attr']) -->
			<!-- loop from=$attr key=$attr_k value=$attr_v -->
			<a href="{echo admin_url('list','action')}&id={$pid}&attr={$attr_v}" class="gray">[{$attrlist[$attr_v]}]</a>
			<!-- /loop -->
		<!-- /if -->
		<!-- if $value.identifier -->
		<span class="gray i">（{$value.identifier}）</span>
		<!-- /if -->
		<!-- if $rs.is_biz -->
		<span class="red i"> {func price_format $value.price $value.currency_id}</span>
		<!-- /if -->
		<!-- if $value.hidden -->
		<span class="red i">({lang隐藏})</span>
		<!-- /if -->
		<!-- if $clist && $clist[$value.id] -->
		<div class="extcate">
			分类：
			<!-- loop from=$clist[$value.id] key=$ck value=$cv -->
			<a href="{url ctrl=list func=action id=$pid cateid=$cv/}" class="i">{$cateall[$cv]}</a> 
			<!-- /loop -->
		</div>
		<!-- /if -->
	</label>
	</td>
	<!-- if $rs.cate -->
	<td class="gray center">
		<!-- if $value.cate_id && is_array($value.cate_id) -->
		<a href="{echo admin_url('list','action')}&id={$pid}&cateid={$value.cate_id.id}">{$value.cate_id.title}</a>
		<!-- else -->
		{lang未设分类}
		<!-- /if -->
	</td>
	<!-- /if -->
	
	<!-- loop from=$layout key=$k value=$v -->
		<!-- if $k == "dateline" -->
		<td class="center">{func date Y-m-d $value.dateline}</td>
		<!-- elseif $k == "hits" -->
		<td class="center">{$value.hits}</td>
		<!-- elseif $k == "user_id" -->
		<td>{$value._user ? $value._user : '-'}</td>
		<!-- else -->
			<!-- if is_array($value[$k])  -->
				<!-- php:$c_list = $value[$k]['_admin'] -->
				<!-- if is_array($c_list.info) -->
				<td>{echo implode(' / ',$c_list.info)}</td>
				<!-- else -->
				<td>{$c_list.info ? $c_list.info : '-'}</td>
				<!-- /if -->
			<!-- else -->
			<td>{$value[$k] ? $value[$k] : '-'}</td>
			<!-- /if -->
		<!-- /if -->
	<!-- /loop -->
	<td class="center"><input type="text" class="short center" value="{$value.sort}" tabindex="{$tmp_m}" onblur="update_taxis(this.value,'{$value.id}')" /></td>
	<td class="center"><span id="taxis_{$value.id}"></span></td>
	<td>
		<!-- if $rs.subtopics && !$value[parent_id] -->
		<a class="ico add" href="{url ctrl=list func=edit parent_id=$value.id pid=$value.project_id/}" title="{lang添加子主题}"></a>
		<!-- else -->
		<a class="ico space"></a>
		<!-- /if -->
		<a class="ico edit" href="{url ctrl=list func=edit id=$value.id/}" title="{lang编辑}"></a>
		<a class="ico delete" onclick="content_del('{$value.id}')" title="{lang删除}"></a>
	</td>
</tr>
	<!-- loop from=$value.sonlist key=$kk value=$vv -->
	<!-- php:$tmp_m++ -->
	<tr id="list_{$vv.id}" title="{$rs.alias_title ? $rs.alias_title : '主题'}：{$vv.title}&#10;发布日期：{echo date('Y-m-d H:i:s',$vv[dateline])}">
		<td class="center"><input type="checkbox" name="ids[]" id="id_{$vv.id}" value="{$vv.id}" /></td>
		<td><span class="status{$vv.status}" id="status_{$vv.id}" onclick="set_status({$vv.id})" value="{$vv.status}"></span></td>
		<td class="center">{$vv.id}</td>
		<td><label for="id_{$vv.id}">
			&nbsp; &nbsp; ├─ {$vv.title}
			<!-- if $vv.attr -->
				<!-- php:$attr = explode(",",$vv['attr']) -->
				<!-- loop from=$attr key=$attr_k value=$attr_v -->
				[{$attrlist[$attr_v]}]
				<!-- /loop -->
			<!-- /if -->
			<!-- if $vv.identifier -->
			<span class="gray i">（{$vv.identifier}）</span>
			<!-- /if -->
			<!-- if $rs.is_biz -->
			<span class="red i"> {func price_format $vv.price $vv.currency_id}</span>
			<!-- /if -->
			<!-- if $vv.hidden -->
			<span class="red i">(隐藏)</span>
			<!-- /if -->
			<!-- if $clist && $clist[$vv.id] -->
			<div class="extcate">
				分类：
				<!-- loop from=$clist[$vv.id] key=$ck value=$cv -->
				<a href="{url ctrl=list func=action id=$pid cateid=$cv/}" class="i">{$cateall[$cv]}</a> 
				<!-- /loop -->
			</div>
			<!-- /if -->
		</label>
		</td>
		<!-- if $rs.cate -->
		<td class="gray center">
			<!-- if $vv.cate_id && is_array($vv.cate_id) -->
			<a href="{echo admin_url('list','action')}&id={$pid}&cateid={$vv.cate_id.id}">{$vv.cate_id.title}</a>
			<!-- else -->
			未设分类
			<!-- /if -->
		<!-- /if -->
		<!-- loop from=$layout key=$k value=$v -->
			<!-- if $k == "dateline" -->
			<td class="center">{echo date("Y-m-d",$vv[dateline])}</td>
			<!-- elseif $k == "hits" -->
			<td class="center">{$vv.hits}</td>
			<!-- elseif $k == 'user_id' -->
			<td>{$vv._user ? $vv._user : '-'}</td>
			<!-- else -->
				<!-- if is_array($vv[$k])  -->
					<!-- php:$c_list = $vv[$k]['_admin'] -->
					<!-- if $c_list.type == 'pic' -->
					<td><img src="{$c_list.info}" width="28px" height="28px" border="0" class="hand" onclick="preview_attr('{$c_list.id}')" style="border:1px solid #dedede;padding:1px;" /></td>
					<!-- else -->
						<!-- if is_array($c_list.info) -->
						<td>{echo implode(' / ',$c_list.info)}</td>
						<!-- else -->
						<td>{$c_list.info ? $c_list.info : '-'}</td>
						<!-- /if -->
					<!-- /if -->
				<!-- else -->
				<td>{$vv[$k] ? $vv[$k] : '-'}</td>
				<!-- /if -->
			<!-- /if -->
		<!-- /loop -->
		<td class="center"><input type="text" class="short center" value="{$vv.sort}" tabindex="{$tmp_m}" onblur="update_taxis(this.value,'{$vv.id}')" /></td>
		<td class="center"><span id="taxis_{$vv.id}"></span></td>
		<td>
			<a class="icon space"></a>
			<a class="ico edit" href="{url ctrl=list func=edit id=$vv.id/}" title="{lang编辑}"></a>
			<a class="ico delete" onclick="content_del('{$vv.id}')" title="{lang删除}"></a>
		</td>
	</tr>
	<!-- /loop -->
<!-- /foreach -->
</table>
</div>
<!-- /if -->
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
	<td>
		<!-- if $rslist -->
		<ul class="layout">
			<li><input type="button" value="{lang全选}" class="btn" onclick="$.input.checkbox_all()" /></li>
			<li><input type="button" value="{lang全不选}" class="btn" onclick="$.input.checkbox_none()" /></li>
			<li><input type="button" value="{lang反选}" class="btn" onclick="$.input.checkbox_anti()" /></li>
			<li><select id="list_action_val" style="width:200px;margin-top:0px;" onchange="update_select()">
				<option value="">{lang选择要执行的动作…}</option>
				<!-- if $opt_catelist -->
				<optgroup label="{lang分类操作}">
					<!-- loop from=$opt_catelist key=$key value=$value -->
					<option value="cate:{$value.id}">{$value._space}{$value.title}</option>
					<!-- /loop -->
				</optgroup>
				<!-- /if -->
				<!-- if $rs.is_attr -->
				<optgroup label="{$rs.alias_title ? $rs.alias_title : '主题'}属性">
					<!-- loop from=$attrlist key=$key value=$value -->
					<option value="attr:{$key}">{$value} {$key}</option>
					<!-- /loop -->
				</optgroup>
				<!-- /if -->
				<optgroup label="其他">
					<option value="status">批量审核</option>
					<option value="unstatus">批量取消审核</option>
					<option value="hidden">批量隐藏</option>
					<option value="show">批量显示</option>
					<option value="delete">批量删除</option>
				</optgroup>
				</select></li>
			<li id="attr_set_li" class="hide">
				<select name="attr_set_val" style="margin-top:0px;" id="attr_set_val">
					<option value="add">添加</option>
					<option value="delete">移除</option>
				</select>
			</li>
			<!-- if $opt_catelist -->
			<li id="cate_set_li" class="hide">
				<select name="cate_set_val" style="margin-top:0px;" id="cate_set_val">
					<!-- if $rs.cate_multiple -->
					<option value="add">添加扩展分类</option>
					<option value="delete">移除分类绑定</option>
					<!-- /if -->
					<option value="move">移动主分类</option>
				</select>
			</li>
			<!-- /if -->
			<li id="plugin_button"><input type="button" value="执行操作" onclick="list_action_exec()" class="submit" /></li>
		</ul>
		<!-- /if -->
	</td>
	<td align="right"><!-- include tpl=pagelist --></td>
</tr>
</table>

<!-- include tpl=foot -->
